// Ben Jebb and Alisa Laufer //
// The "Bad Neighbor" Problem: Do File // 
// December 2024 // 

***** Start of DoFile ***** 


////////// Table 1: GLS Regression; Standard Errors Clustered by Country; Time Fixed Effects Included //////////
 
 
xtset, clear
xtset ccode year

xtreg GTI_score contiguous_neighbors log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year, cluster(ccode)  

xtreg GTI_score top50pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year, cluster(ccode)    

xtreg GTI_score top25pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year, cluster(ccode)   

xtreg GTI_score top10pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year, cluster(ccode)

xtreg GTI_score neighbors_over50pct log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year, cluster(ccode)    

xtset, clear  


/////////// Table 2: GLS Regression; Just Standard Errors Clustered by Country ////////////


xtset, clear
xtset ccode

xtreg GTI_score contiguous_neighbors log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights, cluster(ccode) 

xtreg GTI_score top50pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights, cluster(ccode) 

xtreg GTI_score top25pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights, cluster(ccode)

xtreg GTI_score top10pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights, cluster(ccode)

xtreg GTI_score neighbors_over50pct log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights, cluster(ccode)  

xtset, clear


///// Table A: Mixed Effects Regression; Standard Errors Clustered by Country; Time Fixed Effects Included /////


xtset, clear
xtset ccode

xtmixed GTI_score contiguous_neighbors log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year || ccode:, mle variance vce(cluster ccode)

xtmixed GTI_score top50pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year || ccode:, mle variance vce(cluster ccode)

xtmixed GTI_score top25pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year || ccode:, mle variance vce(cluster ccode)

xtmixed GTI_score top10pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year || ccode:, mle variance vce(cluster ccode)

xtmixed GTI_score neighbors_over50pct log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights i.year || ccode:, mle variance vce(cluster ccode)

xtset, clear 


///// Table B: Mixed Effects Regression; Standard Errors Clustered by Country /////


xtset, clear
xtset ccode

xtmixed GTI_score contiguous_neighbors log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights || ccode: , mle variance  

xtmixed GTI_score top50pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights || ccode: , mle variance

xtmixed GTI_score top25pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights || ccode: , mle variance

xtmixed GTI_score top10pct_binary log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights || ccode: , mle variance

xtmixed GTI_score neighbors_over50pct log_population government_effectiveness log_GDPpercapita youth_unemployment polity_fragmentation polity_score political_rights || ccode: , mle variance 

xtset, clear


//////////////////////////// *** End of Do File *** ///////////////////////////////////////////


